<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<table border="1" width="700" id="dataTable">
		<tr>
			<th>序号</th>
			<th>书号</th>
			<th>书名</th>
			<th>作者</th>
			<th>价格</th>
			<th>库存</th>
			<th>类型</th>
			<th>操作</th>
		</tr>
	<c:forEach items="${bookPage.data}" var="book">
	<tr>
	<td>${book.bookId}</td> 
	<td>${book.bookNo}</td>
	<td>${book.bookName}</td>
	<td>${book.bookWriter}</td>
	<td>${book.bookPrice}</td>
	<td>${book.bookNum}</td>
	<td>${book.bookType}</td>
	<td><a href="deleteBook.do?bookId=${book.bookId}">删除</a></td>
	</tr>
	</c:forEach>	
	</table>
	
	<div>
		<c:if test="${bookPage.hasPrev}">
		<a href="getBook.do?pageNum=${bookPage.pageNum-1}">上一页</a>
		</c:if>
		<c:forEach begin="1" end="${bookPage.totalPages}" var="p">
		<a href="getBook.do?pageNum=${p}">${p}</a>
		</c:forEach>
		<c:if test="${bookPage.hasNext}">
		<a href="getBook.do?pageNum=${bookPage.pageNum+1}">下一页</a>
		</c:if>
	</div>
</body>
</html>